let form = layui.form;
$(function () {

  // 粒子线条背景
  $(document).ready(function () {
    $('.layui-container').particleground({
      dotColor: '#7ec7fd',
      lineColor: '#7ec7fd'
    })
  })




  // 登录操作
  $('form').on('submit', function (e) {
    e.preventDefault();
    var loginData = form.val("formLogin");
    console.log(loginData);
    $.ajax({
      type: 'POST',
      data: loginData,
      url: 'api/login',
      success: function (data) {
        localStorage.setItem('mytoken', data.token);
        location.href = './index.html';
      }
    })
  })

})